﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ArcFaceTest
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {

            ArcFaceCLI.FaceDetection fd = new ArcFaceCLI.FaceDetection();

            string appID="8ixc4R2Lp86xUcPpEur4s14vUupi4YLQMLuG9fEZ5oav";
            string SDKKey = "AutD8xLbYRCGWesWSUNj1ra8eGZaAd5Be42zmQowtvJa";
            int WORKBUF_SIZE = 40*1024*1024; //内存大小
            int nScale = 16; //最小人脸尺寸
            int nMaxFace = 10; // 检测最大人脸数
            //初始化引擎
            var reOk = fd.InitialFaceEngine(appID, SDKKey, WORKBUF_SIZE, nScale, nMaxFace,ArcFaceCLI.AFD_FSDK_OrientPriority.AFD_FSDK_OPF_0_HIGHER_EXT);
            if (reOk==0)
            {
                var version = fd.GetVersion();
                Console.WriteLine(version.Version);
                string path =@"C:\Users\Administrator\Downloads\1-1G013141146451.bmp";
                fd.StillImageFaceDetection(path);
            }

            //释放空间
            fd.UninitialFaceEngine();
            

            return;
            Console.WriteLine(ArcFaceCLI.Class1.StaticMethod());

            ArcFaceCLI.Class1 test = new ArcFaceCLI.Class1();

            Console.WriteLine( test.NormalMethod("    hhkhkhkjhew    "));

            test.StrProp = "属性";
            test.TestInt = 78;

            Console.WriteLine(string.Format("属性:{0} Int:{1}",test.StrProp,test.TestInt));
        }
    }
}
